#ifndef PVECTOR_H
#define PVECTOR_H

class QDomDocument;
class QDomElement;
class QDomNode;

class PVector
{
public:
    PVector(double x = 0, double y = 0);

    PVector operator+(PVector vect) const;
    PVector operator-(PVector vect) const;
    PVector operator*(double c) const;
    PVector operator+=(PVector vect) const;
    PVector operator-=(PVector vect) const;
    PVector operator*=(double c) const;
    double mult(PVector vect) const;
    double distance(PVector vect) const;
    double distanceSqr(PVector vect) const;
    double length() const;

    double getX() const;
    void setX(double x);

    double getY() const;
    void setY(double y);

    void serialize(QDomDocument *doc, QDomElement *e) const;

    static PVector deserialize(QDomNode node);

private:
    double myX;
    double myY;
};

#endif // PVECTOR_H
